using System.Linq;
using System.Text;
using Common;
using Common.Enum;
using Converters;
using SExperiment.ExperimentResult;
using SProject.Paramter;
using SWellPlate;

namespace MainView.MainControls.Chart
{
	public abstract class BaseADCurveChart : BaseCurveChart
	{
		protected override string GetToolTipString(ChartData chartData)
		{
			ADOption adOption = base.Subset.GetSubsetParamter(chartData.WellCell.Well.Project).BasicOption as ADOption;
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.AppendLine(Utility.GetMessage("well_no") + Utility.GetMessage("Colon") + chartData.WellCell.Well.CellName);
			stringBuilder.AppendLine(Utility.GetMessage("Target") + Utility.GetMessage("Colon") + chartData.SampleTargetItem.TargetName);
			stringBuilder.AppendLine(Utility.GetMessage("Type") + Utility.GetMessage("Colon") + EnumManagement.GetSampleTypeName(chartData.SampleTargetItem.SampleType));
			stringBuilder.AppendLine(Utility.GetMessage("property") + Utility.GetMessage("Colon") + chartData.SampleTargetItem.Property);
			stringBuilder.AppendLine(Utility.GetMessage("typing") + Utility.GetMessage("Colon") + ((ADWellResult)chartData.WellCell.Well.Result).TypeName);
			stringBuilder.AppendLine(Utility.GetMessage("method") + Utility.GetMessage("Colon") + (from s in EnumManagement.GetAllADTypeMethod()
				where (EADTypeMethod)s.Key == adOption.TypeMethod
				select s).FirstOrDefault().Value);
			stringBuilder.AppendLine(Utility.GetMessage("quality_factor") + Utility.GetMessage("Colon") + ResultFormat.Format(((ADWellResult)chartData.WellCell.Well.Result).QualityFactor, "#,0.00"));
			stringBuilder.AppendLine(base.TitleX + Utility.GetMessage("Colon") + "#VAL{X}");
			stringBuilder.AppendLine(base.TitleY + Utility.GetMessage("Colon") + "#VALX{Y}");
			return stringBuilder.ToString();
		}
	}
}
